package com.addcn.android.design591.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.addcn.android.design591.R;
import com.addcn.android.design591.comm.Configs;
import com.addcn.android.design591.utils.L;
import com.addcn.android.design591.utils.SPUtils;
import com.addcn.android.design591.utils.ToolUtils;

import java.util.Timer;
import java.util.TimerTask;

/**
 * 欢迎界面
 */
public class WelcomeActivity extends AppCompatActivity {

    public native String stringFromJNI();

    static {
        System.loadLibrary("native-lib");
    }

    private Context context = this;
    private ImageView welcome_icon;
    private TextView welcome_version;
    private LinearLayout activity_main;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        initView();


        configViews();
    }

    private void configViews() {
        welcome_version.setText("V " + ToolUtils.getVersionName(this));


        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                startActivity(new Intent(context, MainActivity.class));
                finish();
            }
        }, 2000);
    }

    private void initView() {
        welcome_icon = (ImageView) findViewById(R.id.welcome_icon);
        welcome_version = (TextView) findViewById(R.id.welcome_version);
        activity_main = (LinearLayout) findViewById(R.id.activity_main);


    }
}
